<script>
export default {
  data() {
    return {
      ruleForm: {
        price: '',
        first: '',
        end:'',
        date1: '',
        date2: '',
        date3:'',
        date4:'',
        region:''
      },
    };
  },
  methods: {
    submitForm(formName) {
      alert("修改成功")
    },
    resetForm(formName) {
      this.$refs[formName].resetFields();
    }
  }
}
</script>
<template>
  <div>
    <el-form :model="ruleForm"  ref="ruleForm" label-width="100px" class="demo-ruleForm">
      <el-form-item label="票价" prop="price">
        <el-input v-model="ruleForm.price"></el-input>
      </el-form-item>
      <el-form-item label="座位" prop="region">
        <el-select style="width: 100%" v-model="ruleForm.region" placeholder="请选择座位">
          <el-option label="一等座" value="0"></el-option>
          <el-option label="二等座" value="1"></el-option>
          <el-option label="无座" value="2"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="始发站" prop="first">
        <el-select style="width: 100%" v-model="ruleForm.first" placeholder="请选择始发站">
          <el-option label="区域一" value="shanghai"></el-option>
          <el-option label="区域二" value="beijing"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="终点站" prop="end">
        <el-select style="width: 100%" v-model="ruleForm.end" placeholder="请选择终点站">
          <el-option label="区域一" value="shanghai"></el-option>
          <el-option label="区域二" value="beijing"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="首发时间" required>
        <el-col :span="11">
          <el-form-item prop="date1">
            <el-date-picker type="date" placeholder="选择日期" v-model="ruleForm.date1" style="width: 100%;"></el-date-picker>
          </el-form-item>
        </el-col>
        <el-col class="line" :span="2">-</el-col>
        <el-col :span="11">
          <el-form-item prop="date2">
            <el-time-picker placeholder="选择时间" v-model="ruleForm.date2" style="width: 100%;"></el-time-picker>
          </el-form-item>
        </el-col>
      </el-form-item>
      <el-form-item label="到达时间" required>
        <el-col :span="11">
          <el-form-item prop="date3">
            <el-date-picker type="date" placeholder="选择日期" v-model="ruleForm.date3" style="width: 100%;"></el-date-picker>
          </el-form-item>
        </el-col>
        <el-col class="line" :span="2">-</el-col>
        <el-col :span="11">
          <el-form-item prop="date4">
            <el-time-picker placeholder="选择时间" v-model="ruleForm.date4" style="width: 100%;"></el-time-picker>
          </el-form-item>
        </el-col>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="submitForm('ruleForm')">立即修改</el-button>
        <el-button @click="resetForm('ruleForm')">重置</el-button>
      </el-form-item>
    </el-form>


  </div>
</template>
<style>
</style>
